package com.zhiyou100.controller.activity;

import com.zhiyou100.dao.Impl.ActivityDaoImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @description:
 * @author: 马跃
 * @create: 2021-01-20 22:59
 **/
@WebServlet("/activityDelete")
public class ActivityDeleteServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int id = Integer.parseInt(request.getParameter("id"));
        new ActivityDaoImpl().delete(id);
        System.out.println(id);
        request.getRequestDispatcher("/activityQueryAll").forward(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
